﻿
using System;
using System.Data;
namespace HuaCheng.Controller
{
    public class TotalTimeControl
    {
        /// <summary>
        /// 计算时间列的总和
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static float CalTotalTime(int count,DataTable dt,string ColumnName)
        {
            float result = 0;
            for (int i = 30 * (count - 2); i < 30 * (count - 1) && i < dt.Rows.Count; i++)
            {
                result += Convert.ToSingle(dt.Rows[i][ColumnName].ToString());
            }
            return result;
        }
    }
}
